package com.dev.stream.For;

import org.junit.Test;

import java.util.Arrays;
import java.util.List;

/**
 * @author 戴 骥
 * @date 2021-09-05 16:32
 */
public class ForEachStream {
    @Test
    public void forEachStream() {
        List<Integer> list = Arrays.asList(7, 6, 9, 3, 8, 2, 1);
        List<Integer> list2 = Arrays.asList(7, 6, 9, 3, 8, 2, 1);

        //1. 顺序遍历
        list.stream().forEach(System.out::print);
        System.out.println();
        System.out.println("==============");
        
        //2. 并行遍历
        list.parallelStream().forEach(System.out::print);

    }
}
